﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Yule8xCommon.Applib;
using Yule8xCommon.Typelib;
using Yule8xModel;

namespace Yule8xWechat.Test
{
    public partial class DailyGetDiamond : System.Web.UI.Page
    {
        protected System.Data.DataTable dtList;
        protected WxUserInfoResult wxUser;
        protected int child_user_count, user_id;
        protected void Page_Load(object sender, EventArgs e)
        {
            user_id = RequestUtil.GetInteger("user_id");
            if (user_id < 1)
            {
                Response.Write("请输入user_id参数");
                Response.End();
            }
            wxUser = UserModels.GetWxUserInfo(user_id);
            if (null == wxUser)
            {
                Response.Write("未登录");
                Response.End();
            }
            tb_user_id.Text = user_id.ToString();
            string msg;
            tb_game_id.Text = UserModels.GetGameID(user_id, null, "bozhong", out msg).ToString();
        }

        protected void btn_submit_Click(object sender, EventArgs e)
        {
            int user_id = StringUtil.ToInteger(tb_user_id.Text);
            int game_id = StringUtil.ToInteger(tb_game_id.Text);
            string msg;
            bool result=UserModels.UserDailyGetDimond(user_id, DateTime.Today, 3, 3, game_id, 1, out msg);
            Response.Write(string.Format("result={0}, msg={1}",result,msg));
        }
    }
}